home *** CD-ROM | disk | FTP | other *** search
- Path: solon.com!not-for-mail
- From: seebs@solutions.solon.com (Peter Seebach)
- Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++,comp.edu
- Subject: Re: ANSI C and POSIX (was Re: C/C++ knocks the crap out of Ada)
- Date: 9 Apr 1996 20:56:07 -0500
- Organization: Usenet Fact Police (Undercover)
- Message-ID: <4kf4fn$bsr@solutions.solon.com>
- References: <JSA.96Feb16135027@organon.com> <dewar.829054330@schonberg> <4ke0ciINNgg8@keats.ugrad.cs.ubc.ca> <EACHUS.96Apr9184019@spectre.mitre.org>
- Reply-To: seebs@solon.com
- NNTP-Posting-Host: solutions.solon.com
-
- In article <EACHUS.96Apr9184019@spectre.mitre.org>,
- Robert I. Eachus <eachus@spectre.mitre.org> wrote:
- > I hope that everyone following this thread knows that this
- >"undefined" behavior lead to one of the security holes exploited by
- >the Morris Internet worm.
-
- No, it quite definitely isn't. The worm mostly used the function gets().
-
- > Undefined only means unusable in some contexts, and if the C read
- >had a way to know the size of the buffer passed, that particular
- >security hole would not have existed.
-
- C does not have a read() function. read() is a feature of Unix or
- POSIX-like systems.
-
- The worm bug had nothing to do with the vague semantics of read. (I've
- talked about this with Robert. I still believe the code was incorrect,
- and he does not deny this, but I would have to say that he's right -
- the standard should be explicit about the requirements of read(), and
- the C standard should likewise be specific about the requirements of
- the buffer passed to fgets(), et al.)
-
- The bug that caused the worm to be dangerous was that gets() has no
- way of determining that there are buffer problems. Good implementations
- will give you a diagnostic message if you use gets().
-
- (Well, NetBSD does.)
-
- -s
- --
- Peter Seebach - seebs@solon.com - Copyright 1996 Peter Seebach.
- C/Unix wizard -- C/Unix questions? Send mail for help. No, really!
- FUCK the communications decency act. Goddamned government. [literally.]
- The *other* C FAQ - http://www.solon.com/~seebs/c/c-iaq.html
-